<template>
  <h2>用户投资明细</h2>
  <table class="table table-bordered" >
      <thead style="background-color: #f5f5f5">
          <tr>
              <th>投资人登录账号</th>
              <th>投资金额</th>
              <th>投资时间</th>
          </tr>
      </thead>
      <tbody>
          <tr v-for="item in info">
              <td>{{item.UL_Name}}</td>
              <td>{{item.UI_Money}}</td>
              <td>{{item.UL_Date.substring(0,10)}}</td>
          </tr>
      </tbody>
     
  </table>
</template>

<script setup lang="ts">
import {ref,onMounted} from 'vue'
import axios from 'axios';

import { useRoute } from 'vue-router';

const route = useRoute();

alert(route.params.Iid)

const info = ref([{
    UL_Name:"",
    UI_Money:0,
    UL_Date:'',
}])

onMounted(()=>{
    LoadInfo();
})

const LoadInfo = ()=>{
    axios({
        url:"https://localhost:44337/api/Invests/GetAllUserInvestInfo",
        method:"get",
        params:{
            Iid:route.params.Iid
        }
    }).then(res=>{
        info.value = res.data;
        console.log(info.value);
    }).catch(err=>{
        console.log(err);
    })
}
</script>